
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" lang="zh">

<head>
    <link rel="StyleSheet" href="../../static/css/jpetstore.css" type="text/css"
          media="screen" />

    <meta name="generator"
          content="HTML Tidy for Linux/x86 (vers 1st November 2002), see www.w3.org" />
    <title>JPetStore Demo</title>
    <meta content="text/html; charset=windows-1252"
          http-equiv="Content-Type" />
    <meta http-equiv="Cache-Control" content="max-age=0" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="expires" content="0" />
    <meta http-equiv="Expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
    <meta http-equiv="Pragma" content="no-cache" />
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
</head>

<body>
<div th:include="~{common/adminTop::adminTop}"></div>
<div class="box">
    <div style="height: 100px"></div><br>
    <table align="center" bgcolor="white">
        <tr>
            <td>adminUsername:</td><td><input type="text" name="username"></td>
        </tr>
        <tr>
            <td>adminPassword:</td><td><input type="password" name="password"></td>
        </tr>
    </table>
    <input type="submit" value="login" name="signOn" onclick="login()">
    <br/>
</div>
<script>
    function login() {
        var username=$("input:text[name='username']").val()
        var password=$("input:password[name='password']").val()
        var signOn ={'username':username,'password':password}
        console.log(JSON.stringify(signOn))
        upload(signOn)
    }

    function upload(signOn){
        $.ajax({
            type:'post',
            url:'/admin/token',
            data: JSON.stringify(signOn),
            contentType:'application/json;charset=utf-8',
            dataType:'json',
            success: function(responseData){
                console.log(responseData.message)
                window.location='/admin/user'
            }
        })
    }
    console.log(document.body.offsetHeight)
    console.log(document.body.clientHeight)
    console.log(document.body.scrollHeight)
</script>
<div th:include="~{common/commonSide::footer}"></div>
</body>
</html>
<style>
    .box{
        margin-top: 100px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        display: block;
        /*border: solid red 2px;*/
        padding-bottom: 20px;
    }

    td,tr {
        /*border-collapse:collapse;*/
        /*border-spacing:0px;*/
        background-color: white;
    }
    input[type="submit"]{
        margin-top: 30px;
        height: 30px;
        background-color:  rgba(58,152,254,1.0);
        font-size: 20px;
        color: #FFFFFF;
        outline: none;
        border: none;
        box-shadow: 1px 0px 2px gray,
        0px -1px 2px  gray,
        -1px 0px 2px gray,
        0px 1px 2px  gray;
    }
    input[type="submit"]:hover {
        background-color: rgba(0,0,255,0.7);
    }
</style>

